<?php
// +----------------------------------------------------------------------
// | 有小象汇 自研正版源码 赋能开发者
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 http://www.uxphp.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 有小象汇并不是自由软件，未经许可不能去掉有小象汇相关版权
// +----------------------------------------------------------------------
// | Author:  有小象汇
// +----------------------------------------------------------------------

namespace app\dao\car;


use app\dao\BaseDao;
use app\model\car\CarTypeInfo;

/**
 * Class CarTypeInfoDao
 * @package app\dao\shendeng
 */
class CarTypeInfoDao extends BaseDao
{
    protected function setModel(): string
    {
        return CarTypeInfo::class;
    }
    /**
     * 列表
     * @param array $where
     * @param string $field
     * @param int $page
     * @param int $limit
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getList(array $where = [], string $field = '*', int $page = 0,int $limit){
        return $this->search($where)
            ->with(['carBrand','carCategory'])
            ->field($field)
            ->order('id desc')
            ->page($page, $limit)
            ->select()->toArray();
    }
}
